unsigned long direct_mmap(unsigned long, unsigned long, pgprot_t, int, int);
int direct_unmap(unsigned long, unsigned long);
- int direct_disc_unmap(unsigned long, unsigned long, int);
-static unsigned char readbuf[1204];
-
-static int cmd_read_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- strcpy(page, readbuf);
- *readbuf = '\0';
- *eof = 1;
- *start = page;
- return strlen(page);
-}
-
static ssize_t dom_usage_read(struct file * file, char * buff, size_t size, loff_t * off)
{
char str[256];
{
dom_mem_t mem_data;
+ printk("dom_mem_write called: Shouldn't happen.\n");
+
copy_from_user(&mem_data, (dom_mem_t *)buff, sizeof(dom_mem_t));
- if(direct_disc_unmap(mem_data.vaddr, mem_data.start_pfn,
- mem_data.tot_pages) == 0){
+ if ( direct_unmap(mem_data.vaddr,
+ mem_data.tot_pages << PAGE_SHIFT) == 0 ) {
return sizeof(sizeof(dom_mem_t));
} else {
return -1;
* found from frame table beginning at the given first_pg index
*/
int direct_remap_disc_page_range(unsigned long from,
- unsigned long first_pg, int tot_pages, pgprot_t prot)
+ unsigned long first_pg, int tot_pages, pgprot_t prot)
{
dom0_op_t dom0_op;
- unsigned long *pfns = get_free_page(GFP_KERNEL);
+ unsigned long *pfns = (unsigned long *)get_free_page(GFP_KERNEL);
unsigned long start = from;
int pages, i;
}
}
- out:
+ out:
- free_page(pfns);
+ free_page((unsigned long)pfns);
return tot_pages;
}